﻿using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
using Xms.Abp.Data;
using Xms.Abp.Modularity;
using Xms.Abp.Settings;
using Xms.Abp.Messaging.Localization;
using Xms.Abp.BackgroundJob;

namespace Xms.Abp.Messaging.Smsing;

[DependsOn(
    typeof(XmsAbpBackgroundJobsModule),
    typeof(XmsAbpDataModule),
    typeof(XmsAbpSettingsModule)
    )]
public class XmsAbpMessagingModule : XmsModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpVirtualFileSystemOptions>(options =>
        {
            options.FileSets.AddEmbedded<XmsAbpMessagingModule >();
        });

        Configure<AbpLocalizationOptions>(options =>
        {
            options.Resources
                .Add<MessagingResource>("en")
                .AddVirtualJson("/Messaging/Localization/Resources");
        });

        Configure<AbpExceptionLocalizationOptions>(options =>
        {
            options.MapCodeNamespace("Messaging", typeof(MessagingResource));
        });
    }
}

